import React,{ComponentType} from 'react'
import { Navigate  }from 'react-router-dom';


function HoLogin(Com:ComponentType<any>) {
    return (props:any) =>{
        const token = window.localStorage.getItem('token');
        if(!token){
            return <Navigate to={'/Login'}></Navigate>
        }
        return (
            <Com {...props}></Com>
        )
    }
}

export default HoLogin